﻿@page "/Try"
@using SQLite
<div class="row g-3">
    <div class="col-12 col-sm-6">
        <label for="text1" class="form-label">姓名:</label>
        <input id="text1" class="form-control">
    </div>
    <div class="col-12 col-sm-6">
        <label for="text2" class="form-label">地址:</label>
        <input id="text2" class="form-control">
    </div>
    <div class="col-12">
        <label for="text3" class="form-label">照片:</label>
        <InputUpload TValue="string" ShowDeleteButton="true" OnChange="@OnFileChange" OnDelete="@OnFileDelete"></InputUpload>
    </div>
</div>
@code{
    [NotNull]
    private ConsoleLogger? Logger1 { get; set; }
    private Task OnFileChange(UploadFile file)
    {
    // 未真正保存文件
    //file.SaveToFile()
        Logger1?.Log($"{file.File!.Name} {"上传成功"}");
        return Task.FromResult("");
    }

    private Task<bool> OnFileDelete(UploadFile item)
    {
        Logger1?.Log($"{item.OriginFileName} {"成功移除"}");
        return Task.FromResult(true);
    }

}